package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableName;
//import com.example.demo.group.Group_1;
//import com.example.demo.group.Group_2;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data                 //@Data注解在类上时，简化java代码编写，为该类提供读写属性。简单来说就是不用再手动添加get/set等方法了
@TableName("user")    //绑定表
public class User implements Serializable {

//    @NotNull(groups = {Group_1.class}, message = "id不能为空")
    private Integer id;
//    @NotNull(groups = {Group_2.class}, message = "用户名不能为空！")
    private String userName;
//    @NotNull(groups = {Group_2.class}, message = "昵称不能为空！")
    private String nickName;
//    @NotNull(groups = {Group_2.class}, message = "年龄不能为空！")
//    @Range(min = 1, max = 99, message = "年龄必须在合法值范围内")
    private Integer age;
}
